main: pull: Reduce the status line length a bit
authorColin Walters <walters@verbum.org>
Tue, 23 Jul 2013 21:29:46 +0000 (17:29 -0400)
committerColin Walters <walters@verbum.org>
Tue, 23 Jul 2013 21:29:46 +0000 (17:29 -0400)
Drop "objects" where it's obvious [ to me anyways =) ], and drop the
bytes transferred since our math was off, and the HTTP status kind of
shows that.

src/libostree/ostree-repo-pull.c

index ec5701d1aa099e44f3553abf22a818819388044f..9f38ed363c78f4040bc7c6d6ac6035367a32c340 100644 (file)
@@ -189,51 +189,28 @@ uri_fetch_update_status (gpointer user_data)
   OtPullData *pull_data = user_data;
   gs_free char *fetcher_status = NULL;
   GString *status;
-  guint64 current_bytes_transferred;
-  guint64 current_delta_bytes_transferred;
-  guint64 delta_bytes_transferred;
   guint outstanding_stages;
   guint outstanding_fetches;
  
   status = g_string_new ("");
 
   if (!pull_data->metadata_scan_idle)
-    g_string_append_printf (status, "scan: %u metadata; ",
+    g_string_append_printf (status, "scan: %u; ",
                             g_atomic_int_get (&pull_data->n_scanned_metadata));
 
   outstanding_stages = pull_data->n_outstanding_content_stage_requests + pull_data->n_outstanding_metadata_stage_requests;
   if (outstanding_stages > 0)
-    g_string_append_printf (status, "writing: %u objects; ", outstanding_stages);
+    g_string_append_printf (status, "writing: %u; ", outstanding_stages);
 
   outstanding_fetches = pull_data->n_outstanding_content_fetches + pull_data->n_outstanding_metadata_fetches;
   if (outstanding_fetches)
     {
-      g_string_append_printf (status, "fetch: %u/%u metadata %u/%u content; ",
+      g_string_append_printf (status, "fetch: %u/%u meta %u/%u; ",
                               pull_data->n_fetched_metadata,
                               pull_data->n_requested_metadata,
                               pull_data->n_fetched_content,
                               pull_data->n_requested_content);
 
-      current_bytes_transferred = ostree_fetcher_bytes_transferred (pull_data->fetcher);
-      current_delta_bytes_transferred = current_bytes_transferred - pull_data->previous_total_downloaded;
-
-      if (pull_data->have_previous_bytes)
-        delta_bytes_transferred = (guint64)(0.5 * current_delta_bytes_transferred + 0.5 * pull_data->previous_bytes_sec);
-      else
-        {
-          pull_data->have_previous_bytes = TRUE;
-          delta_bytes_transferred = current_delta_bytes_transferred;
-        }
-      pull_data->previous_bytes_sec = delta_bytes_transferred;
-      pull_data->previous_total_downloaded = current_bytes_transferred;
-      
-      if (delta_bytes_transferred < 1024)
-        g_string_append_printf (status, "%u B/s; ", 
-                                (guint)delta_bytes_transferred);
-      else
-        g_string_append_printf (status, "%.1f KiB/s; ", 
-                                (double)delta_bytes_transferred / 1024);
-
       fetcher_status = ostree_fetcher_query_state_text (pull_data->fetcher);
       g_string_append (status, fetcher_status);
     }